package ce.com.cenewbluesdk.entity.k2;

import android.os.Parcel;
import android.os.Parcelable;

import java.io.Serializable;

import ce.com.cenewbluesdk.uitl.ByteUtil;

/**
 * Created by Administrator on 2016/11/28 0028.
 */
public class K2_Sport implements Parcelable {



    private int starTime;
    private int walkSteps;
    private int distance;
    private int calories;
    private int duration;




    public K2_Sport(byte[] bytes) {
        this.starTime = ByteUtil.byte4ToInt(new byte[]{bytes[0],bytes[1],bytes[2],bytes[3]});
        this.walkSteps = ByteUtil.byte4ToInt(new byte[]{bytes[4],bytes[5],bytes[6],bytes[7]});
        this.distance = ByteUtil.byte3ToInt(new byte[]{bytes[8],bytes[9],bytes[10]});
        this.calories = ByteUtil.byte2ToInt(new byte[]{bytes[11],bytes[12]});
        this.duration = ByteUtil.byte3ToInt(new byte[]{bytes[13],bytes[14],bytes[15]});
    }

    public K2_Sport() {
    }


    protected K2_Sport(Parcel in) {
        starTime = in.readInt();
        walkSteps = in.readInt();
        distance = in.readInt();
        calories = in.readInt();
        duration = in.readInt();
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(starTime);
        dest.writeInt(walkSteps);
        dest.writeInt(distance);
        dest.writeInt(calories);
        dest.writeInt(duration);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<K2_Sport> CREATOR = new Creator<K2_Sport>() {
        @Override
        public K2_Sport createFromParcel(Parcel in) {
            return new K2_Sport(in);
        }

        @Override
        public K2_Sport[] newArray(int size) {
            return new K2_Sport[size];
        }
    };

    public int getStarTime() {
        return starTime;
    }

    public void setStarTime(int starTime) {
        this.starTime = starTime;
    }

    public int getWalkSteps() {
        return walkSteps;
    }

    public void setWalkSteps(int walkSteps) {
        this.walkSteps = walkSteps;
    }

    public int getDistance() {
        return distance;
    }

    public void setDistance(int distance) {
        this.distance = distance;
    }

    public int getCalories() {
        return calories;
    }

    public void setCalories(int calories) {
        this.calories = calories;
    }

    public int getDuration() {
        return duration;
    }

    public void setDuration(int duration) {
        this.duration = duration;
    }

    public static int getItemSize() {
        return 16;
    }



}
